package com.qkl.xiatang.app.dto.wvp;

import com.qkl.xiatang.app.utils.ControlUtils;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.Map;

@Data
public class ControlFrontEndDTO {

    private String channelId;

    private Integer cmdCode;

    private Integer parameter1;

    private Integer parameter2;

    private Integer combindCode2;

    public Map<String,String> toParams(){
        Map<String,String> map = new HashMap<>();
        map.put("channelId", StringUtils.trimToEmpty(channelId));
        ControlUtils.putParam(map,"cmdCode",cmdCode);
        ControlUtils.putParam(map,"parameter1",parameter1);
        ControlUtils.putParam(map,"parameter2",parameter2);
        ControlUtils.putParam(map,"combindCode2",combindCode2);
        return map;
    }

    public static void main(String[] args) {
        ControlFrontEndDTO dto = new ControlFrontEndDTO();
        dto.setChannelId("31011500991310026322");
        dto.setCmdCode(0);
        dto.setCombindCode2(0);
        dto.setParameter1(0);
        dto.setParameter2(0);
        System.out.println(com.alibaba.fastjson.JSON.toJSONString(dto));
    }

}
